package com.teach.service.http;

import java.io.File;
import java.io.InputStream;

import org.apache.http.entity.ContentType;

/**
 * <pre>
 * 文件域参数
 * 创建时间：2019年11月21日 下午6:55:01
 * Copyright 2019 jlzhou.top Inc. All rights reserved. 
 * 注意：本内容仅限于公司内部传阅，禁止外泄以及用于其他的商业目</pre>
 * @author J.L.Zhou
 * @version V1.0
 */
public class MultipartFile {

	private String name;
	private File value;
	
	private InputStream stream;
	private ContentType contentType;
	private String filename;
	
	public MultipartFile(String name) {
		super();
		this.name = name;
	}
	public MultipartFile() {
		super();
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		if(name==null||"".equals(name)){
			throw new RuntimeException("参数名不能为空!");
		}
		this.name = name;
	}
	public File getValue() {
		return value;
	}
	public void setValue(File value) {
		if(value==null){
			throw new RuntimeException("文件不能为空");
		}
		if(!value.exists()){
			throw new RuntimeException("文件必须存在");
		}
		this.value = value;
	}
	public InputStream getStream() {
		return stream;
	}
	public void setStream(InputStream stream) {
		this.stream = stream;
	}
	public ContentType getContentType() {
		return contentType;
	}
	public void setContentType(ContentType contentType) {
		this.contentType = contentType;
	}
	public String getFilename() {
		return filename;
	}
	public void setFilename(String filename) {
		this.filename = filename;
	}
	
	
	
	
}
